$(document).ready(function() {
	$(".loginbnt").click(function() {
        var username = $("#username").val();
        var password = $("#password").val();
        if (username =="") {
        	jAlert("请填写登录用户","登录失败","");
        	return false;
        }else if(password ==""){
        	jAlert("请填写登录密码","登录失败","");
        	return false;
        }
        var data = {username:username,password:password}
        $.ajax({
            url: "index.php?go=softpos.auth.ajaxlogin",
            type: 'post',
            dataType: 'json',
            data: data,
            success: function(response) {
                if (response.success == "success") {
                    jAlert(response.data,"登录成功",function(r) {
                        if (r==true) {
                            location.href = response.url
                        }
                    });
                } else {
                    jAlert(response.data,"登录失败","");
                }
            }
        });
     });
});